package start;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    static ApplicationContext context;

    public static void main(String[] args) {
        context = new ClassPathXmlApplicationContext("META-INF\\beans1.xml");
        Runnable r = new Runnable() {
            @Override
            public void run() {
                A a = (A)context.getBean("a");
                for (int i = 0; i < 1; i++)
                    a.doIt();
            }
        };
        Thread t1 = new Thread(r,"t1");
        Thread t2 = new Thread(r,"t2");
        t1.start();
        t2.start();
    }
}
